import request from '@/utils/http'
import { BaseResponse } from '@/types/api'
import { DriverListType } from './modules/driverModel'
export class DriverSchool {
  // 驾校列表
  static driverSchoolList(params: object) {
    return request.get<BaseResponse<DriverListType>>({
      url: '/ds-store/page',
      params
    })
  }
  // 驾校广告
  static dsNotices(params: object) {
    return request.get<BaseResponse<DriverListType>>({
      url: 'ds-notices/page',
      params
    })
  }
  // 驾校信息
  static driverInfo(id: number) {
    return request.get<BaseResponse<DriverListType>>({
      url: `ds-store/${id}`
    })
  }
  // 驾校编辑
  static driverEdit(id: number, params: object) {
    return request.put<BaseResponse<DriverListType>>({
      url: `ds-store/${id}`,
      params
    })
  }
}

// 驾校信息
export function getDriverSchoolInfo(id: number) {
  return request.get<BaseResponse>({
    url: `ds-driving-school/${id}`
  })
}
// 新增驾校信息
export function AddDriverSchoolInfo(data: object) {
  return request.post<BaseResponse>({
    url: `ds-driving-school`,
    data
  })
}
//编辑驾校信息
export function EditDriverSchoolInfo(data: object) {
  return request.put<BaseResponse>({
    url: `ds-driving-school`,
    data
  })
}

export function getCarTypeList(params: object) {
  return request.get<BaseResponse>({
    url: '/ds-car-model/page',
    params
  })
}

export function editsCarType(data: object) {
  return request.post<BaseResponse>({
    url: '/ds-car-model-user',
    data
  })
}
// 驾校报名点
export function getDriveSchoolList(data: object) {
  return request.get<BaseResponse>({
    url: '/ds-registration-site/page',
    params: data
  })
}
// 新增驾校报名点
export function AddDriveSchoolList(data: object) {
  return request.post<BaseResponse>({
    url: '/ds-registration-site',
    data
  })
}
// 编辑驾校报名点
export function EditDriveSchoolList(data: object) {
  return request.put<BaseResponse>({
    url: '/ds-registration-site',
    data
  })
}
// 删除驾校报名点
export function deleteDriveSchool(id: number) {
  return request.del<BaseResponse>({
    url: `/ds-registration-site/${id}`
  })
}
// 驾校招生员
export function getStudentsList(data: object) {
  return request.get<BaseResponse>({
    url: '/recruitingSpecialist/page',
    params: data
  })
}
// 新增驾校招生员
export function AddStudents(data: object) {
  return request.post<BaseResponse>({
    url: '/recruitingSpecialist',
    data
  })
}
// 编辑驾校招生员
export function EditStudents(id: number, data: object) {
  return request.put<BaseResponse>({
    url: `/recruitingSpecialist/${id}`,
    data
  })
}
// 删除驾校招生员
export function DelStudents(ids: number) {
  return request.del<BaseResponse>({
    url: `/recruitingSpecialist/${ids}`
  })
}
// 教练信息
export function getCoach(data: object) {
  return request.get<BaseResponse>({
    url: `/Coach/page`,
    params: data
  })
}
// 添加教练信息
export function AddCoachInfo(data: object) {
  return request.post<BaseResponse>({
    url: `/Coach`,
    data
  })
}
// 编辑教练信息
export function EditCoachInfo(id: number, data: object) {
  return request.put<BaseResponse>({
    url: `/Coach/${id}`,
    data
  })
}
// 编辑教练信息
export function DelCoachInfo(ids: number) {
  return request.del<BaseResponse>({
    url: `/Coach/${ids}`
  })
}
// 基础设置
export function BasicSetting() {
  return request.get<BaseResponse>({
    url: 'ds-store/byId'
  })
}
// 修改基础设置
export function EditBasicSetting(id: number, data: object) {
  return request.put<BaseResponse>({
    url: `ds-store/${id}`,
    data
  })
}
// 客服设置
export function kefuSetting() {
  return request.get<BaseResponse>({
    url: 'ds-customer/storeCustomer'
  })
}
// 新增/修改客服设置
export function addKefuSetting(data: object) {
  return request.post<BaseResponse>({
    url: 'ds-customer',
    data
  })
}
// 帮助中心列表
export function helpList(data: object) {
  return request.get<BaseResponse>({
    url: 'dsArticle/page',
    params: data
  })
}
// 新增/修改帮助中心
export function addHelpCenter(data: object) {
  return request.post<BaseResponse>({
    url: 'dsArticle',
    data
  })
}
// 删除帮助中心
export function DelHelpCenter(ids: number) {
  return request.del<BaseResponse>({
    url: `/dsArticle/${ids}`
  })
}
// 学员班型列表
export function StudentClassTypeLis(data: object) {
  return request.get<BaseResponse>({
    url: 'ds-store-package/page',
    params: data
  })
}
// 新增/修改学员班型
export function AddStudentType(data: object) {
  return request.post<BaseResponse>({
    url: 'ds-store-package',
    data
  })
}
// 新增/修改学员班型
export function EditStudentType(data: object) {
  return request.put<BaseResponse>({
    url: 'ds-store-package',
    data
  })
}
// 删除学员班型
export function DelStudentType(id: number) {
  return request.del<BaseResponse>({
    url: `ds-store-package/${id}`
  })
}
// 登录日志
export function loginLog(data: object) {
  return request.get<BaseResponse>({
    url: `logs/page`,
    params: data
  })
}
// 更新日志
export function updateLog(data: object) {
  return request.get<BaseResponse>({
    url: `ds-sys-update-log/page`,
    params: data
  })
}
// 员工管理
export function staffList(data: object) {
  return request.get<BaseResponse>({
    url: `staff/page`,
    params: data
  })
}
// 新增员工管理
export function AddStaffList(data: object) {
  return request.post<BaseResponse>({
    url: `staff`,
    data
  })
}
// 编辑员工管理
export function EditStaffList(id: number, data: object) {
  return request.put<BaseResponse>({
    url: `staff/${id}`,
    data
  })
}
// 删除员工管理
export function DelStaffList(ids: string) {
  return request.del<BaseResponse>({
    url: `staff/${ids}`
  })
}
// 角色管理
export function RolesList(data: object) {
  return request.get<BaseResponse>({
    url: `roles/page`,
    params: data
  })
}
// 新增角色管理
export function AddRoles(data: object) {
  return request.post<BaseResponse>({
    url: `roles`,
    data
  })
}
// 编辑角色管理
export function EditRoles(id: number, data: object) {
  return request.put<BaseResponse>({
    url: `roles/${id}`,
    data
  })
}
// 修改角色状态
export function EditStatus(roleId: number, status: number) {
  return request.put<BaseResponse>({
    url: `/roles/${roleId}/status?status=${status}`
  })
}
// 删除角色
export function DelRoles(ids: string) {
  return request.del<BaseResponse>({
    url: `roles/${ids}`
  })
}
// 训练场
export function trainingGround(data: object) {
  return request.get<BaseResponse>({
    url: `trainingGround/page`,
    params: data
  })
}
// 新增训练场
export function AddTrainingGround(data: object) {
  return request.post<BaseResponse>({
    url: `trainingGround`,
    data
  })
}
// 编辑训练场
export function EditTrainingGround(data: object) {
  return request.put<BaseResponse>({
    url: `trainingGround`,
    data
  })
}
// 删除训练场
export function DelTrainingGround(id: number) {
  return request.del<BaseResponse>({
    url: `trainingGround/${id}`,
  })
}
// 新增/修改车型对应提示配置
export function saveSettings(data: object) {
  return request.post<BaseResponse>({
    url: `ds-car-model-user/saveSettings`,
    data
  })
}
// 新增/修改车型对应提示配置
export function getSettings(carId: number) {
  return request.get<BaseResponse>({
    url: `ds-car-model-user/getSettings/${carId}`
  })
}
// 获取菜单精简信息列表
export function getMenuInfoSimple() {
  return request.get<BaseResponse>({
    url: `dsmenu/list-all-simple`
  })
}
// 获取菜单精简信息列表
export function assignRoles(data: object) {
  return request.post<BaseResponse>({
    url: `dspermission/assign-role-menu`,
    data
  })
}
// 获得管理员拥有的角色编号列表
export function getRoleCodeList(data: object) {
  return request.get<BaseResponse>({
    url: `dspermission/getRoleMenuList`,
    params: data
  })
}
